Flash memory is a non-volatile semiconductor memory chip with certain advantages such as small volume, low power consumption, and less susceptibility to physical damages, and is an ideal storage medium for mobile digital products.
According to internal architectures and implementation techniques, flash memory can be separated into several types, such as AND, NAND, NOR and DiNOR. Currently, the NAND-type flash memory remains as the mainstream. NAND technology is often advantageous because of its high write-back speed, small chip area, and large storage capacities. With the NAND technology, the basic storage unit of a flash memory chip is called a page, typically containing 512, 2048, 4096, or 8192 bytes. A number of pages form a block, and the size of the block equals to the product of the size of the page and the total number of pages in the block.
Blocks in different flash memory chips may have different number of pages, usually ranging from 16 to 128 pages. Data are written to the flash memory using the page as a unit, but the pages must be erased before being written. The erasing is performed using the block as a unit, as the flash memory consists of serially-arranged blocks. In fact, NAND-type flash memory is a sequentially-readable device, and it only takes an 8-bit I/O port to access the data using the page as the unit.
Reading and erasing files in NAND flash memory, especially continuous large-volume files, is very fast. However, the random access speed is lower, because the flash memory cannot be written in byte. Further, it is easy for the NAND flash memory to develop bad blocks. A bad block appears when certain bit(s) of certain byte(s) in a page cannot be programmed, usually a ‘1’ not being able to be programmed to a ‘0’. In order to ensure the security of data during flash memory access, and to avoid accessing bad blocks, a controller is added, usually during the design, to manage any bad blocks. When there is data access to a bad block, the controller transfers the data access to a predetermined spare storage space. Thus, the bad blocks are not used and the data security and integrity is ensured.
Flash memory manufactured using existing technologies generally went through a mass production process, where, through certain means, bad blocks in the flash memory are identified and marked. At the same time, a certain number of good blocks are set aside as spare blocks or replacement blocks. When bad blocks appear during later use processes, these spare blocks can be used to replace the bad blocks. FIG. 3 shows a flow diagram for a bad block scanning and marking process during the mass production using the existing technologies.
Chinese patent application no. CN10139462A discloses “a method and apparatus for dynamically compensating defective flash memory,” which reserves a group of good blocks from the flash memory as replacement blocks. Through testing, if any bad block is found, a good block from the group is used to replace the bad block, while the bad block is placed at the end of the group of good blocks. Thus, such approach protects the data security by reserving good blocks in the flash memory as the replacement blocks.
Because NAND flash memory is prone to developing bad blocks, when the memory capacity increases, the number of bad blocks in the flash memory can also increase. Only setting aside certain good blocks can leave those bad blocks that are sensitive only to certain data unused and, thus, decrease the capacity of the entire flash memory. Thus, it appears that existing technologies do not use flash memory bad blocks, and these flash memory bad blocks may include those being sensitive only to certain data, which means that not all bad blocks in the flash memory are unusable. If those flash memory bad blocks are left unused, as the capacity of the flash memory keeps increasing, more and more memory space will be wasted. FIG. 4 shows a flow diagram for processing bad blocks using the existing technologies.
The disclosed methods and systems are directed to solve one or more problems set forth above and other problems.